home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_gtk / INCLUDE / GDK / GDK.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  33KB  |  1,024 lines

  1. /* GDK - The GIMP Drawing Kit
  2.  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
  3.  *
  4.  * This library is free software; you can redistribute it and/or
  5.  * modify it under the terms of the GNU Library General Public
  6.  * License as published by the Free Software Foundation; either
  7.  * version 2 of the License, or (at your option) any later version.
  8.  *
  9.  * This library is distributed in the hope that it will be useful,
  10.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.     See the GNU
  12.  * Library General Public License for more details.
  13.  *
  14.  * You should have received a copy of the GNU Library General Public
  15.  * License along with this library; if not, write to the
  16.  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  17.  * Boston, MA 02111-1307, USA.
  18.  */
  19.  
  20. /*
  21.  * Modified by the GTK+ Team and others 1997-1999.  See the AUTHORS
  22.  * file for a list of people on the GTK+ Team.  See the ChangeLog
  23.  * files for a list of changes.  These files are distributed with
  24.  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
  25.  */
  26.  
  27. #ifndef __GDK_H__
  28. #define __GDK_H__
  29.  
  30.  
  31. #include <gdk/gdktypes.h>
  32.  
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif /* __cplusplus */
  36.  
  37.  
  38. /* Initialization, exit and events
  39.  */
  40. #define      GDK_PRIORITY_EVENTS        (G_PRIORITY_DEFAULT)
  41. void       gdk_init               (gint           *argc,
  42.                      gchar        ***argv);
  43. gboolean  gdk_init_check               (gint           *argc,
  44.                      gchar        ***argv);
  45. void        gdk_exit               (gint             error_code);
  46. gchar*      gdk_set_locale           (void);
  47.  
  48. /* Push and pop error handlers for X errors
  49.  */
  50. void      gdk_error_trap_push           (void);
  51. gint      gdk_error_trap_pop            (void);
  52.  
  53.  
  54. gboolean  gdk_events_pending         (void);
  55. GdkEvent* gdk_event_get            (void);
  56.  
  57. GdkEvent* gdk_event_peek                (void);
  58. GdkEvent* gdk_event_get_graphics_expose (GdkWindow     *window);
  59. void      gdk_event_put             (GdkEvent      *event);
  60.  
  61. GdkEvent* gdk_event_copy             (GdkEvent     *event);
  62. void      gdk_event_free             (GdkEvent     *event);
  63. guint32   gdk_event_get_time         (GdkEvent     *event);
  64.  
  65. void      gdk_event_handler_set     (GdkEventFunc    func,
  66.                      gpointer        data,
  67.                      GDestroyNotify  notify);
  68.  
  69. void      gdk_set_show_events        (gint         show_events);
  70. void      gdk_set_use_xshm        (gint         use_xshm);
  71.  
  72. gint      gdk_get_show_events        (void);
  73. gint      gdk_get_use_xshm        (void);
  74. gchar*      gdk_get_display        (void);
  75.  
  76. guint32 gdk_time_get      (void);
  77. guint32 gdk_timer_get      (void);
  78. void    gdk_timer_set      (guint32 milliseconds);
  79. void    gdk_timer_enable  (void);
  80. void    gdk_timer_disable (void);
  81.  
  82. gint gdk_input_add_full      (gint             source,
  83.                GdkInputCondition condition,
  84.                GdkInputFunction  function,
  85.                gpointer         data,
  86.                GdkDestroyNotify  destroy);
  87. gint gdk_input_add      (gint             source,
  88.                GdkInputCondition condition,
  89.                GdkInputFunction  function,
  90.                gpointer         data);
  91. void gdk_input_remove      (gint             tag);
  92.  
  93. gint gdk_pointer_grab    (GdkWindow *     window,
  94.              gint         owner_events,
  95.              GdkEventMask     event_mask,
  96.              GdkWindow *     confine_to,
  97.              GdkCursor *     cursor,
  98.              guint32     time);
  99. void gdk_pointer_ungrab (guint32     time);
  100.  
  101. gint gdk_keyboard_grab     (GdkWindow *      window,
  102.               gint          owner_events,
  103.               guint32      time);
  104. void gdk_keyboard_ungrab (guint32      time);
  105.  
  106. gint gdk_pointer_is_grabbed (void);
  107.  
  108. gint gdk_screen_width  (void);
  109. gint gdk_screen_height (void);
  110.  
  111. gint gdk_screen_width_mm  (void);
  112. gint gdk_screen_height_mm (void);
  113.  
  114. void gdk_flush (void);
  115. void gdk_beep (void);
  116.  
  117. void gdk_key_repeat_disable (void);
  118. void gdk_key_repeat_restore (void);
  119.  
  120.  
  121. /* Visuals
  122.  */
  123. gint          gdk_visual_get_best_depth         (void);
  124. GdkVisualType gdk_visual_get_best_type         (void);
  125. GdkVisual*    gdk_visual_get_system         (void);
  126. GdkVisual*    gdk_visual_get_best         (void);
  127. GdkVisual*    gdk_visual_get_best_with_depth (gint         depth);
  128. GdkVisual*    gdk_visual_get_best_with_type  (GdkVisualType  visual_type);
  129. GdkVisual*    gdk_visual_get_best_with_both  (gint         depth,
  130.                           GdkVisualType  visual_type);
  131.  
  132. /* Actually, these are no-ops... */
  133. GdkVisual* gdk_visual_ref (GdkVisual *visual);
  134. void       gdk_visual_unref (GdkVisual *visual);
  135.  
  136. void gdk_query_depths        (gint        **depths,
  137.                  gint         *count);
  138. void gdk_query_visual_types (GdkVisualType  **visual_types,
  139.                  gint         *count);
  140.  
  141. GList* gdk_list_visuals (void);
  142.  
  143.  
  144. /* Windows
  145.  */
  146. GdkWindow*    gdk_window_new         (GdkWindow        *parent,
  147.                       GdkWindowAttr *attributes,
  148.                       gint         attributes_mask);
  149.  
  150. void          gdk_window_destroy     (GdkWindow        *window);
  151. GdkWindow*    gdk_window_ref         (GdkWindow        *window);
  152. void          gdk_window_unref         (GdkWindow        *window);
  153.  
  154. GdkWindow*    gdk_window_at_pointer  (gint       *win_x,
  155.                       gint       *win_y);
  156. void          gdk_window_show         (GdkWindow       *window);
  157. void          gdk_window_hide         (GdkWindow       *window);
  158. void          gdk_window_withdraw    (GdkWindow       *window);
  159. void          gdk_window_move         (GdkWindow       *window,
  160.                       gint        x,
  161.                       gint        y);
  162. void          gdk_window_resize         (GdkWindow       *window,
  163.                       gint        width,
  164.                       gint        height);
  165. void          gdk_window_move_resize (GdkWindow       *window,
  166.                       gint        x,
  167.                       gint        y,
  168.                       gint        width,
  169.                       gint        height);
  170. void          gdk_window_reparent    (GdkWindow       *window,
  171.                       GdkWindow       *new_parent,
  172.                       gint        x,
  173.                       gint        y);
  174. void          gdk_window_clear         (GdkWindow       *window);
  175. void          gdk_window_clear_area  (GdkWindow       *window,
  176.                       gint        x,
  177.                       gint        y,
  178.                       gint        width,
  179.                       gint        height);
  180. void          gdk_window_clear_area_e(GdkWindow       *window,
  181.                       gint        x,
  182.                       gint        y,
  183.                       gint        width,
  184.                       gint        height);
  185. void          gdk_window_copy_area   (GdkWindow       *window,
  186.                       GdkGC       *gc,
  187.                       gint        x,
  188.                       gint        y,
  189.                       GdkWindow       *source_window,
  190.                       gint        source_x,
  191.                       gint        source_y,
  192.                       gint        width,
  193.                       gint        height);
  194. void          gdk_window_raise         (GdkWindow       *window);
  195. void          gdk_window_lower         (GdkWindow       *window);
  196.  
  197. void          gdk_window_set_user_data     (GdkWindow      *window,
  198.                       gpointer       user_data);
  199. void          gdk_window_set_override_redirect(GdkWindow  *window,
  200.                            gboolean override_redirect);
  201.  
  202. void          gdk_window_add_filter    (GdkWindow     *window,
  203.                      GdkFilterFunc    function,
  204.                      gpointer    data);
  205. void          gdk_window_remove_filter    (GdkWindow     *window,
  206.                      GdkFilterFunc    function,
  207.                      gpointer    data);
  208.  
  209. /* 
  210.  * This allows for making shaped (partially transparent) windows
  211.  * - cool feature, needed for Drag and Drag for example.
  212.  *  The shape_mask can be the mask
  213.  *  from gdk_pixmap_create_from_xpm.   Stefan Wille
  214.  */
  215. void gdk_window_shape_combine_mask (GdkWindow        *window,
  216.                     GdkBitmap        *shape_mask,
  217.                     gint         offset_x,
  218.                     gint         offset_y);
  219. /*
  220.  * This routine allows you to quickly take the shapes of all the child windows
  221.  * of a window and use their shapes as the shape mask for this window - useful
  222.  * for container windows that dont want to look like a big box
  223.  * 
  224.  * - Raster
  225.  */
  226. void gdk_window_set_child_shapes (GdkWindow *window);
  227.  
  228. /*
  229.  * This routine allows you to merge (ie ADD) child shapes to your
  230.  * own window's shape keeping its current shape and ADDING the shild
  231.  * shapes to it.
  232.  * 
  233.  * - Raster
  234.  */
  235. void gdk_window_merge_child_shapes (GdkWindow *window);
  236.  
  237. /*
  238.  * Check if a window has been shown, and whether all it's
  239.  * parents up to a toplevel have been shown, respectively.
  240.  * Note that a window that is_viewable below is not necessarily
  241.  * viewable in the X sense.
  242.  */
  243. gboolean gdk_window_is_visible     (GdkWindow *window);
  244. gboolean gdk_window_is_viewable    (GdkWindow *window);
  245.  
  246. /* Set static bit gravity on the parent, and static
  247.  * window gravity on all children.
  248.  */
  249. gboolean gdk_window_set_static_gravities (GdkWindow *window,
  250.                       gboolean   use_static);   
  251. /*
  252.  * The following function adds a global filter for all client
  253.  * messages of type message_type
  254.  */
  255. void gdk_add_client_message_filter (GdkAtom       message_type,
  256.                     GdkFilterFunc func,
  257.                     gpointer      data);
  258.  
  259. /* Drag and Drop */
  260.  
  261. GdkDragContext * gdk_drag_context_new        (void);
  262. void             gdk_drag_context_ref        (GdkDragContext *context);
  263. void             gdk_drag_context_unref      (GdkDragContext *context);
  264.  
  265. /* Destination side */
  266.  
  267. void             gdk_drag_status        (GdkDragContext   *context,
  268.                          GdkDragAction     action,
  269.                      guint32           time);
  270. void             gdk_drop_reply         (GdkDragContext   *context,
  271.                      gboolean          ok,
  272.                      guint32           time);
  273. void             gdk_drop_finish        (GdkDragContext   *context,
  274.                      gboolean          success,
  275.                      guint32           time);
  276. GdkAtom          gdk_drag_get_selection (GdkDragContext   *context);
  277.  
  278. /* Source side */
  279.  
  280. GdkDragContext * gdk_drag_begin      (GdkWindow      *window,
  281.                       GList          *targets);
  282. guint32         gdk_drag_get_protocol (guint32          xid,
  283.                        GdkDragProtocol *protocol);
  284. void             gdk_drag_find_window (GdkDragContext   *context,
  285.                        GdkWindow       *drag_window,
  286.                         gint             x_root,
  287.                        gint             y_root,
  288.                        GdkWindow      **dest_window,
  289.                        GdkDragProtocol *protocol);
  290. gboolean        gdk_drag_motion      (GdkDragContext *context,
  291.                       GdkWindow      *dest_window,
  292.                       GdkDragProtocol protocol,
  293.                       gint            x_root, 
  294.                       gint            y_root,
  295.                       GdkDragAction   suggested_action,
  296.                       GdkDragAction   possible_actions,
  297.                       guint32         time);
  298. void            gdk_drag_drop        (GdkDragContext *context,
  299.                       guint32         time);
  300. void            gdk_drag_abort       (GdkDragContext *context,
  301.                       guint32         time);
  302.  
  303. GdkAtom       gdk_drag_get_selection (GdkDragContext *context);
  304.  
  305. /* GdkWindow */
  306.  
  307. void          gdk_window_set_hints     (GdkWindow      *window,
  308.                       gint           x,
  309.                       gint           y,
  310.                       gint           min_width,
  311.                       gint           min_height,
  312.                       gint           max_width,
  313.                       gint           max_height,
  314.                       gint           flags);
  315. void          gdk_window_set_geometry_hints (GdkWindow        *window,
  316.                          GdkGeometry      *geometry,
  317.                          GdkWindowHints    flags);
  318. void          gdk_set_sm_client_id         (const gchar *sm_client_id);
  319.  
  320.  
  321. void          gdk_window_set_title       (GdkWindow      *window,
  322.                         const gchar      *title);
  323. void          gdk_window_set_role          (GdkWindow       *window,
  324.                         const gchar     *role);
  325. void          gdk_window_set_transient_for (GdkWindow       *window, 
  326.                         GdkWindow       *leader);
  327. void          gdk_window_set_background     (GdkWindow      *window,
  328.                       GdkColor      *color);
  329. void          gdk_window_set_back_pixmap (GdkWindow      *window,
  330.                       GdkPixmap      *pixmap,
  331.                       gint           parent_relative);
  332. void          gdk_window_set_cursor     (GdkWindow      *window,
  333.                       GdkCursor      *cursor);
  334. void          gdk_window_set_colormap     (GdkWindow      *window,
  335.                       GdkColormap      *colormap);
  336. void          gdk_window_get_user_data     (GdkWindow      *window,
  337.                       gpointer      *data);
  338. void          gdk_window_get_geometry     (GdkWindow      *window,
  339.                       gint          *x,
  340.                       gint          *y,
  341.                       gint          *width,
  342.                       gint          *height,
  343.                       gint          *depth);
  344. void          gdk_window_get_position     (GdkWindow      *window,
  345.                       gint          *x,
  346.                       gint          *y);
  347. void          gdk_window_get_size     (GdkWindow      *window,
  348.                       gint          *width,
  349.                       gint          *height);
  350. GdkVisual*    gdk_window_get_visual     (GdkWindow      *window);
  351. GdkColormap*  gdk_window_get_colormap     (GdkWindow      *window);
  352. GdkWindowType gdk_window_get_type     (GdkWindow      *window);
  353. gint          gdk_window_get_origin     (GdkWindow      *window,
  354.                       gint          *x,
  355.                       gint          *y);
  356. gboolean      gdk_window_get_deskrelative_origin (GdkWindow      *window,
  357.                       gint          *x,
  358.                       gint          *y);
  359. void          gdk_window_get_root_origin (GdkWindow      *window,
  360.                       gint          *x,
  361.                       gint          *y);
  362. GdkWindow*    gdk_window_get_pointer     (GdkWindow      *window,
  363.                       gint          *x,
  364.                       gint          *y,
  365.                       GdkModifierType *mask);
  366. GdkWindow*    gdk_window_get_parent     (GdkWindow      *window);
  367. GdkWindow*    gdk_window_get_toplevel     (GdkWindow      *window);
  368. GList*          gdk_window_get_children     (GdkWindow      *window);
  369. GdkEventMask  gdk_window_get_events     (GdkWindow      *window);
  370. void          gdk_window_set_events     (GdkWindow      *window,
  371.                       GdkEventMask       event_mask);
  372.  
  373. void          gdk_window_set_icon     (GdkWindow      *window, 
  374.                       GdkWindow      *icon_window,
  375.                       GdkPixmap      *pixmap,
  376.                       GdkBitmap      *mask);
  377. void          gdk_window_set_icon_name     (GdkWindow      *window, 
  378.                       gchar          *name);
  379. void          gdk_window_set_group     (GdkWindow      *window, 
  380.                       GdkWindow      *leader);
  381. void          gdk_window_set_decorations (GdkWindow      *window,
  382.                       GdkWMDecoration  decorations);
  383. void          gdk_window_set_functions     (GdkWindow      *window,
  384.                       GdkWMFunction       functions);
  385. GList *       gdk_window_get_toplevels   (void);
  386.  
  387. void          gdk_window_register_dnd    (GdkWindow       *window);
  388.  
  389. void          gdk_drawable_set_data      (GdkDrawable     *drawable,
  390.                       const gchar     *key,
  391.                       gpointer       data,
  392.                       GDestroyNotify   destroy_func);
  393.                       
  394.  
  395. /* Cursors
  396.  */
  397. GdkCursor* gdk_cursor_new         (GdkCursorType      cursor_type);
  398. GdkCursor* gdk_cursor_new_from_pixmap     (GdkPixmap      *source,
  399.                       GdkPixmap      *mask,
  400.                       GdkColor      *fg,
  401.                       GdkColor      *bg,
  402.                       gint           x,
  403.                       gint           y);
  404. void       gdk_cursor_destroy         (GdkCursor     *cursor);
  405.  
  406.  
  407. /* GCs
  408.  */
  409. GdkGC* gdk_gc_new          (GdkWindow        *window);
  410. GdkGC* gdk_gc_new_with_values      (GdkWindow        *window,
  411.                    GdkGCValues        *values,
  412.                    GdkGCValuesMask   values_mask);
  413. GdkGC* gdk_gc_ref          (GdkGC        *gc);
  414. void   gdk_gc_unref          (GdkGC        *gc);
  415. void   gdk_gc_destroy          (GdkGC        *gc);
  416. void   gdk_gc_get_values      (GdkGC        *gc,
  417.                    GdkGCValues        *values);
  418. void   gdk_gc_set_foreground      (GdkGC        *gc,
  419.                    GdkColor        *color);
  420. void   gdk_gc_set_background      (GdkGC        *gc,
  421.                    GdkColor        *color);
  422. void   gdk_gc_set_font          (GdkGC        *gc,
  423.                    GdkFont        *font);
  424. void   gdk_gc_set_function      (GdkGC        *gc,
  425.                    GdkFunction         function);
  426. void   gdk_gc_set_fill          (GdkGC        *gc,
  427.                    GdkFill         fill);
  428. void   gdk_gc_set_tile          (GdkGC        *gc,
  429.                    GdkPixmap        *tile);
  430. void   gdk_gc_set_stipple      (GdkGC        *gc,
  431.                    GdkPixmap        *stipple);
  432. void   gdk_gc_set_ts_origin      (GdkGC        *gc,
  433.                    gint             x,
  434.                    gint             y);
  435. void   gdk_gc_set_clip_origin      (GdkGC        *gc,
  436.                    gint             x,
  437.                    gint             y);
  438. void   gdk_gc_set_clip_mask      (GdkGC        *gc,
  439.                    GdkBitmap        *mask);
  440. void   gdk_gc_set_clip_rectangle  (GdkGC        *gc,
  441.                    GdkRectangle        *rectangle);
  442. void   gdk_gc_set_clip_region      (GdkGC        *gc,
  443.                    GdkRegion        *region);
  444. void   gdk_gc_set_subwindow      (GdkGC        *gc,
  445.                    GdkSubwindowMode  mode);
  446. void   gdk_gc_set_exposures      (GdkGC        *gc,
  447.                    gint             exposures);
  448. void   gdk_gc_set_line_attributes (GdkGC        *gc,
  449.                    gint             line_width,
  450.                    GdkLineStyle         line_style,
  451.                    GdkCapStyle         cap_style,
  452.                    GdkJoinStyle         join_style);
  453. void   gdk_gc_set_dashes          (GdkGC            *gc,
  454.                    gint                 dash_offset,
  455.                    gchar             dash_list[],
  456.                    gint              n);
  457. void   gdk_gc_copy          (GdkGC         *dst_gc,
  458.                    GdkGC         *src_gc);
  459.  
  460.  
  461. /* Pixmaps
  462.  */
  463. GdkPixmap* gdk_pixmap_new        (GdkWindow  *window,
  464.                      gint         width,
  465.                      gint         height,
  466.                      gint         depth);
  467. GdkBitmap* gdk_bitmap_create_from_data    (GdkWindow   *window,
  468.                      const gchar *data,
  469.                      gint          width,
  470.                      gint          height);
  471. GdkPixmap* gdk_pixmap_create_from_data    (GdkWindow   *window,
  472.                      const gchar *data,
  473.                      gint          width,
  474.                      gint          height,
  475.                      gint          depth,
  476.                      GdkColor    *fg,
  477.                      GdkColor    *bg);
  478. GdkPixmap* gdk_pixmap_create_from_xpm    (GdkWindow  *window,
  479.                      GdkBitmap **mask,
  480.                      GdkColor   *transparent_color,
  481.                      const gchar *filename);
  482. GdkPixmap* gdk_pixmap_colormap_create_from_xpm 
  483.                                         (GdkWindow   *window,
  484.                      GdkColormap *colormap,
  485.                      GdkBitmap  **mask,
  486.                      GdkColor    *transparent_color,
  487.                      const gchar *filename);
  488. GdkPixmap* gdk_pixmap_create_from_xpm_d (GdkWindow  *window,
  489.                      GdkBitmap **mask,
  490.                      GdkColor   *transparent_color,
  491.                      gchar       **data);
  492. GdkPixmap* gdk_pixmap_colormap_create_from_xpm_d 
  493.                                         (GdkWindow   *window,
  494.                      GdkColormap *colormap,
  495.                      GdkBitmap  **mask,
  496.                      GdkColor    *transparent_color,
  497.                      gchar     **data);
  498. GdkPixmap *gdk_pixmap_ref        (GdkPixmap  *pixmap);
  499. void       gdk_pixmap_unref        (GdkPixmap  *pixmap);
  500.  
  501. GdkBitmap *gdk_bitmap_ref        (GdkBitmap  *pixmap);
  502. void       gdk_bitmap_unref        (GdkBitmap  *pixmap);
  503.  
  504.  
  505. /* Images
  506.  */
  507. GdkImage* gdk_image_new_bitmap(GdkVisual     *visual,
  508.                 gpointer      data,
  509.                 gint          width,
  510.                 gint          height);
  511. GdkImage*  gdk_image_new       (GdkImageType  type,
  512.                 GdkVisual    *visual,
  513.                 gint          width,
  514.                 gint          height);
  515. GdkImage*  gdk_image_get       (GdkWindow    *window,
  516.                 gint          x,
  517.                 gint          y,
  518.                 gint          width,
  519.                 gint          height);
  520. void       gdk_image_put_pixel (GdkImage     *image,
  521.                 gint          x,
  522.                 gint          y,
  523.                 guint32          pixel);
  524. guint32       gdk_image_get_pixel (GdkImage     *image,
  525.                 gint          x,
  526.                 gint          y);
  527. void       gdk_image_destroy   (GdkImage     *image);
  528.  
  529.  
  530. /* Color
  531.  */
  532. GdkColormap* gdk_colormap_new      (GdkVisual   *visual,
  533.                    gint        allocate);
  534. GdkColormap* gdk_colormap_ref      (GdkColormap *cmap);
  535. void         gdk_colormap_unref      (GdkColormap *cmap);
  536.  
  537. GdkColormap* gdk_colormap_get_system       (void);
  538. gint         gdk_colormap_get_system_size  (void);
  539.  
  540. void gdk_colormap_change (GdkColormap    *colormap,
  541.               gint         ncolors);
  542.  
  543.  
  544. gint  gdk_colormap_alloc_colors   (GdkColormap *colormap,
  545.                    GdkColor    *colors,
  546.                    gint         ncolors,
  547.                    gboolean     writeable,
  548.                    gboolean     best_match,
  549.                    gboolean    *success);
  550. gboolean gdk_colormap_alloc_color (GdkColormap *colormap,
  551.                    GdkColor    *color,
  552.                    gboolean     writeable,
  553.                    gboolean     best_match);
  554. void     gdk_colormap_free_colors (GdkColormap *colormap,
  555.                    GdkColor    *colors,
  556.                    gint         ncolors);
  557.  
  558. GdkVisual *gdk_colormap_get_visual (GdkColormap *colormap);
  559.      
  560. GdkColor *gdk_color_copy (GdkColor *color);
  561. void      gdk_color_free (GdkColor *color);
  562.  
  563. gint gdk_color_parse     (const gchar    *spec,
  564.               GdkColor    *color);
  565. guint gdk_color_hash     (const GdkColor *colora,
  566.               const GdkColor *colorb);
  567. gint gdk_color_equal     (const GdkColor *colora,
  568.               const GdkColor *colorb);
  569.  
  570.  
  571. /* The following functions are deprecated */
  572. void gdk_colors_store     (GdkColormap    *colormap,
  573.               GdkColor    *colors,
  574.               gint         ncolors);
  575. gint gdk_colors_alloc     (GdkColormap    *colormap,
  576.               gint         contiguous,
  577.               gulong    *planes,
  578.               gint         nplanes,
  579.               gulong    *pixels,
  580.               gint         npixels);
  581. void gdk_colors_free     (GdkColormap    *colormap,
  582.               gulong    *pixels,
  583.               gint         npixels,
  584.               gulong     planes);
  585. gint gdk_color_white     (GdkColormap    *colormap,
  586.               GdkColor    *color);
  587. gint gdk_color_black     (GdkColormap    *colormap,
  588.               GdkColor    *color);
  589. gint gdk_color_alloc     (GdkColormap    *colormap,
  590.               GdkColor    *color);
  591. gint gdk_color_change     (GdkColormap    *colormap,
  592.               GdkColor    *color);
  593.  
  594.  
  595. /* Fonts
  596.  */
  597. GdkFont* gdk_font_load        (const gchar    *font_name);
  598. GdkFont* gdk_fontset_load   (gchar          *fontset_name);
  599. GdkFont* gdk_font_ref        (GdkFont        *font);
  600. void     gdk_font_unref        (GdkFont        *font);
  601. gint     gdk_font_id        (const GdkFont  *font);
  602. gint     gdk_font_equal        (const GdkFont  *fonta,
  603.                  const GdkFont  *fontb);
  604. gint     gdk_string_width   (GdkFont        *font,
  605.                  const gchar    *string);
  606. gint     gdk_text_width        (GdkFont        *font,
  607.                  const gchar    *text,
  608.                  gint            text_length);
  609. gint     gdk_text_width_wc  (GdkFont        *font,
  610.                  const GdkWChar *text,
  611.                  gint            text_length);
  612. gint     gdk_char_width        (GdkFont        *font,
  613.                  gchar           character);
  614. gint     gdk_char_width_wc  (GdkFont        *font,
  615.                  GdkWChar        character);
  616. gint     gdk_string_measure (GdkFont        *font,
  617.                  const gchar    *string);
  618. gint     gdk_text_measure   (GdkFont        *font,
  619.                  const gchar    *text,
  620.                  gint            text_length);
  621. gint     gdk_char_measure   (GdkFont        *font,
  622.                  gchar           character);
  623. gint     gdk_string_height  (GdkFont        *font,
  624.                  const gchar    *string);
  625. gint     gdk_text_height    (GdkFont        *font,
  626.                  const gchar    *text,
  627.                  gint            text_length);
  628. gint     gdk_char_height    (GdkFont        *font,
  629.                  gchar           character);
  630.  
  631. void     gdk_text_extents   (GdkFont     *font,
  632.                  const gchar *text,
  633.                  gint         text_length,
  634.                  gint        *lbearing,
  635.                  gint        *rbearing,
  636.                  gint        *width,
  637.                  gint        *ascent,
  638.                  gint        *descent);
  639. void    gdk_text_extents_wc (GdkFont        *font,
  640.                  const GdkWChar *text,
  641.                  gint            text_length,
  642.                  gint           *lbearing,
  643.                  gint           *rbearing,
  644.                  gint           *width,
  645.                  gint           *ascent,
  646.                  gint           *descent);
  647. void     gdk_string_extents (GdkFont     *font,
  648.                  const gchar *string,
  649.                  gint        *lbearing,
  650.                  gint        *rbearing,
  651.                  gint        *width,
  652.                  gint        *ascent,
  653.                  gint        *descent);
  654.  
  655. /* Drawing
  656.  */
  657. void gdk_draw_point     (GdkDrawable  *drawable,
  658.               GdkGC           *gc,
  659.               gint        x,
  660.               gint        y);
  661. void gdk_draw_line     (GdkDrawable  *drawable,
  662.               GdkGC           *gc,
  663.               gint        x1,
  664.               gint        y1,
  665.               gint        x2,
  666.               gint        y2);
  667. void gdk_draw_rectangle     (GdkDrawable  *drawable,
  668.               GdkGC           *gc,
  669.               gint        filled,
  670.               gint        x,
  671.               gint        y,
  672.               gint        width,
  673.               gint        height);
  674. void gdk_draw_arc     (GdkDrawable  *drawable,
  675.               GdkGC           *gc,
  676.               gint        filled,
  677.               gint        x,
  678.               gint        y,
  679.               gint        width,
  680.               gint        height,
  681.               gint        angle1,
  682.               gint        angle2);
  683. void gdk_draw_polygon     (GdkDrawable  *drawable,
  684.               GdkGC           *gc,
  685.               gint        filled,
  686.               GdkPoint     *points,
  687.               gint        npoints);
  688. void gdk_draw_string     (GdkDrawable  *drawable,
  689.               GdkFont      *font,
  690.               GdkGC           *gc,
  691.               gint        x,
  692.               gint        y,
  693.               const gchar  *string);
  694. void gdk_draw_text     (GdkDrawable  *drawable,
  695.               GdkFont      *font,
  696.               GdkGC           *gc,
  697.               gint        x,
  698.               gint        y,
  699.               const gchar  *text,
  700.               gint        text_length);
  701. void gdk_draw_text_wc     (GdkDrawable     *drawable,
  702.               GdkFont     *font,
  703.               GdkGC         *gc,
  704.               gint          x,
  705.               gint          y,
  706.               const GdkWChar *text,
  707.               gint          text_length);
  708. void gdk_draw_pixmap     (GdkDrawable  *drawable,
  709.               GdkGC           *gc,
  710.               GdkDrawable  *src,
  711.               gint        xsrc,
  712.               gint        ysrc,
  713.               gint        xdest,
  714.               gint        ydest,
  715.               gint        width,
  716.               gint        height);
  717. void gdk_draw_bitmap     (GdkDrawable  *drawable,
  718.               GdkGC           *gc,
  719.               GdkDrawable  *src,
  720.               gint        xsrc,
  721.               gint        ysrc,
  722.               gint        xdest,
  723.               gint        ydest,
  724.               gint        width,
  725.               gint        height);
  726. void gdk_draw_image     (GdkDrawable  *drawable,
  727.               GdkGC           *gc,
  728.               GdkImage     *image,
  729.               gint        xsrc,
  730.               gint        ysrc,
  731.               gint        xdest,
  732.               gint        ydest,
  733.               gint        width,
  734.               gint        height);
  735. void gdk_draw_points     (GdkDrawable  *drawable,
  736.               GdkGC           *gc,
  737.               GdkPoint     *points,
  738.               gint        npoints);
  739. void gdk_draw_segments     (GdkDrawable  *drawable,
  740.               GdkGC           *gc,
  741.               GdkSegment   *segs,
  742.               gint        nsegs);
  743. void gdk_draw_lines      (GdkDrawable  *drawable,
  744.                           GdkGC        *gc,
  745.                           GdkPoint     *points,
  746.                           gint          npoints);
  747.  
  748.  
  749.  
  750.  
  751. /* Selections
  752.  */
  753. gint       gdk_selection_owner_set (GdkWindow     *owner,
  754.                     GdkAtom      selection,
  755.                     guint32      time,
  756.                     gint      send_event);
  757. GdkWindow* gdk_selection_owner_get (GdkAtom      selection);
  758. void       gdk_selection_convert   (GdkWindow     *requestor,
  759.                     GdkAtom      selection,
  760.                     GdkAtom      target,
  761.                     guint32      time);
  762. gint       gdk_selection_property_get (GdkWindow  *requestor,
  763.                        guchar     **data,
  764.                        GdkAtom      *prop_type,
  765.                        gint      *prop_format);
  766. void       gdk_selection_send_notify (guint32        requestor,
  767.                       GdkAtom        selection,
  768.                       GdkAtom        target,
  769.                       GdkAtom        property,
  770.                       guint32        time);
  771.  
  772. gint       gdk_text_property_to_text_list (GdkAtom encoding, gint format,
  773.                        guchar *text, gint length,
  774.                        gchar ***list);
  775. void       gdk_free_text_list          (gchar **list);
  776. gint       gdk_string_to_compound_text      (gchar *str,
  777.                        GdkAtom *encoding, gint *format,
  778.                        guchar **ctext, gint *length);
  779. void       gdk_free_compound_text      (guchar *ctext);
  780.  
  781. /* Properties
  782.  */
  783. GdkAtom gdk_atom_intern        (const gchar *atom_name,
  784.                  gint      only_if_exists);
  785. gchar*    gdk_atom_name        (GdkAtom atom);
  786. gint    gdk_property_get    (GdkWindow     *window,
  787.                  GdkAtom      property,
  788.                  GdkAtom      type,
  789.                  gulong      offset,
  790.                  gulong      length,
  791.                  gint      pdelete,
  792.                  GdkAtom     *actual_property_type,
  793.                  gint     *actual_format,
  794.                  gint     *actual_length,
  795.                  guchar    **data);
  796.  
  797. void    gdk_property_change (GdkWindow     *window,
  798.                  GdkAtom      property,
  799.                  GdkAtom      type,
  800.                  gint      format,
  801.                  GdkPropMode  mode,
  802.                  guchar     *data,
  803.                  gint      nelements);
  804. void    gdk_property_delete (GdkWindow     *window,
  805.                  GdkAtom      property);
  806.  
  807.  
  808. /* Rectangle utilities
  809.  */
  810. gint gdk_rectangle_intersect (GdkRectangle *src1,
  811.                   GdkRectangle *src2,
  812.                   GdkRectangle *dest);
  813. void gdk_rectangle_union     (GdkRectangle *src1,
  814.                   GdkRectangle *src2,
  815.                   GdkRectangle *dest);
  816.  
  817. /* XInput support
  818.  */
  819.  
  820. void gdk_input_init                (void);
  821. void gdk_input_exit                (void);
  822. GList *gdk_input_list_devices            (void);
  823. void gdk_input_set_extension_events        (GdkWindow *window,
  824.                          gint mask,
  825.                          GdkExtensionMode mode);
  826. void gdk_input_set_source            (guint32 deviceid,
  827.                          GdkInputSource source);
  828. gint gdk_input_set_mode                (guint32 deviceid,
  829.                          GdkInputMode mode);
  830. void gdk_input_set_axes                (guint32 deviceid,
  831.                          GdkAxisUse *axes);
  832. void gdk_input_set_key                (guint32 deviceid,
  833.                          guint   index,
  834.                          guint   keyval,
  835.                          GdkModifierType modifiers);
  836. void gdk_input_window_get_pointer     (GdkWindow       *window,
  837.                        guint32           deviceid,
  838.                        gdouble           *x,
  839.                        gdouble           *y,
  840.                        gdouble           *pressure,
  841.                        gdouble           *xtilt,
  842.                        gdouble           *ytilt,
  843.                        GdkModifierType *mask);
  844.  
  845. GdkTimeCoord *gdk_input_motion_events (GdkWindow *window,
  846.                        guint32 deviceid,
  847.                        guint32 start,
  848.                        guint32 stop,
  849.                        gint *nevents_return);
  850.  
  851. /* International Input Method Support Functions
  852.  */
  853.  
  854. gint         gdk_im_ready       (void);
  855.  
  856. void         gdk_im_begin       (GdkIC               *ic, 
  857.                     GdkWindow           *window);
  858. void         gdk_im_end           (void);
  859. GdkIMStyle   gdk_im_decide_style   (GdkIMStyle           supported_style);
  860. GdkIMStyle   gdk_im_set_best_style (GdkIMStyle           best_allowed_style);
  861.  
  862. GdkIC*       gdk_ic_new           (GdkICAttr         *attr,
  863.                     GdkICAttributesType mask);
  864. void         gdk_ic_destroy       (GdkIC               *ic);
  865. GdkIMStyle   gdk_ic_get_style       (GdkIC               *ic);
  866. GdkEventMask gdk_ic_get_events     (GdkIC               *ic);
  867.  
  868. GdkICAttr*   gdk_ic_attr_new       (void);
  869. void         gdk_ic_attr_destroy   (GdkICAttr *attr);
  870.  
  871. GdkICAttributesType  gdk_ic_set_attr (GdkIC              *ic,  
  872.                                       GdkICAttr          *attr,
  873.                                       GdkICAttributesType mask);
  874. GdkICAttributesType  gdk_ic_get_attr (GdkIC              *ic, 
  875.                                       GdkICAttr          *attr,
  876.                                       GdkICAttributesType mask);
  877.  
  878. /* Conversion functions between wide char and multibyte strings. 
  879.  */
  880. gchar     *gdk_wcstombs          (const GdkWChar   *src);
  881. gint       gdk_mbstowcs          (GdkWChar         *dest,
  882.                   const gchar      *src,
  883.                   gint              dest_max);
  884.  
  885.  
  886. /* Color Context */
  887.  
  888. GdkColorContext *gdk_color_context_new              (GdkVisual   *visual,
  889.                                GdkColormap *colormap);
  890.  
  891. GdkColorContext *gdk_color_context_new_mono          (GdkVisual   *visual,
  892.                                GdkColormap *colormap);
  893.  
  894. void         gdk_color_context_free              (GdkColorContext *cc);
  895.  
  896. gulong         gdk_color_context_get_pixel          (GdkColorContext *cc,
  897.                                gushort        red,
  898.                                gushort        green,
  899.                                gushort        blue,
  900.                                gint           *failed);
  901. void         gdk_color_context_get_pixels          (GdkColorContext *cc,
  902.                                gushort       *reds,
  903.                                gushort       *greens,
  904.                                gushort       *blues,
  905.                                gint            ncolors,
  906.                                gulong       *colors,
  907.                                gint           *nallocated);
  908. void         gdk_color_context_get_pixels_incremental (GdkColorContext *cc,
  909.                                gushort       *reds,
  910.                                gushort       *greens,
  911.                                gushort       *blues,
  912.                                gint            ncolors,
  913.                                gint           *used,
  914.                                gulong       *colors,
  915.                                gint           *nallocated);
  916.  
  917. gint         gdk_color_context_query_color          (GdkColorContext *cc,
  918.                                GdkColor       *color);
  919. gint         gdk_color_context_query_colors          (GdkColorContext *cc,
  920.                                GdkColor       *colors,
  921.                                gint            num_colors);
  922.  
  923. gint         gdk_color_context_add_palette          (GdkColorContext *cc,
  924.                                GdkColor       *palette,
  925.                                gint            num_palette);
  926.  
  927. void         gdk_color_context_init_dither          (GdkColorContext *cc);
  928. void         gdk_color_context_free_dither          (GdkColorContext *cc);
  929.  
  930. gulong         gdk_color_context_get_pixel_from_palette (GdkColorContext *cc,
  931.                                gushort       *red,
  932.                                gushort       *green,
  933.                                gushort       *blue,
  934.                                gint           *failed);
  935. guchar         gdk_color_context_get_index_from_palette (GdkColorContext *cc,
  936.                                gint           *red,
  937.                                gint           *green,
  938.                                gint           *blue,
  939.                                gint           *failed);
  940. /* Regions
  941.  */
  942.  
  943. GdkRegion*     gdk_region_new        (void);
  944. void           gdk_region_destroy   (GdkRegion       *region);
  945.  
  946. void           gdk_region_get_clipbox(GdkRegion    *region,
  947.                       GdkRectangle *rectangle);
  948.  
  949. gboolean       gdk_region_empty        (GdkRegion       *region);
  950. gboolean       gdk_region_equal        (GdkRegion       *region1,
  951.                      GdkRegion       *region2);
  952. gboolean       gdk_region_point_in  (GdkRegion       *region,
  953.                      int           x,
  954.                      int           y);
  955. GdkOverlapType gdk_region_rect_in   (GdkRegion       *region,
  956.                      GdkRectangle  *rect);
  957.  
  958. GdkRegion*     gdk_region_polygon   (GdkPoint      *points,
  959.                      gint           npoints,
  960.                      GdkFillRule    fill_rule);
  961.  
  962. void           gdk_region_offset   (GdkRegion       *region,
  963.                     gint       dx,
  964.                     gint       dy);
  965. void           gdk_region_shrink   (GdkRegion       *region,
  966.                     gint       dx,
  967.                     gint       dy);
  968.  
  969. GdkRegion*    gdk_region_union_with_rect  (GdkRegion      *region,
  970.                        GdkRectangle      *rect);
  971. GdkRegion*    gdk_regions_intersect      (GdkRegion      *source1,
  972.                        GdkRegion      *source2);
  973. GdkRegion*    gdk_regions_union          (GdkRegion      *source1,
  974.                        GdkRegion      *source2);
  975. GdkRegion*    gdk_regions_subtract      (GdkRegion      *source1,
  976.                        GdkRegion      *source2);
  977. GdkRegion*    gdk_regions_xor          (GdkRegion      *source1,
  978.                        GdkRegion      *source2);
  979.  
  980. /* Miscellaneous */
  981. void     gdk_event_send_clientmessage_toall (GdkEvent    *event);
  982. gboolean gdk_event_send_client_message (GdkEvent    *event,
  983.                     guint32      xid);
  984.  
  985. /* Key values
  986.  */
  987. gchar*   gdk_keyval_name          (guint    keyval);
  988. guint    gdk_keyval_from_name          (const gchar *keyval_name);
  989. guint    gdk_keyval_to_upper          (guint    keyval);
  990. guint    gdk_keyval_to_lower          (guint    keyval);
  991. gboolean gdk_keyval_is_upper          (guint    keyval);
  992. gboolean gdk_keyval_is_lower          (guint    keyval);
  993.  
  994. /* Threading
  995.  */
  996.  
  997. extern GMutex *gdk_threads_mutex;
  998.  
  999. void     gdk_threads_enter                (void);
  1000. void     gdk_threads_leave                (void);
  1001.  
  1002. #ifdef    G_THREADS_ENABLED
  1003. #  define GDK_THREADS_ENTER()    G_STMT_START {    \
  1004.       if (gdk_threads_mutex)                     \
  1005.         g_mutex_lock (gdk_threads_mutex);       \
  1006.    } G_STMT_END
  1007. #  define GDK_THREADS_LEAVE()    G_STMT_START {     \
  1008.       if (gdk_threads_mutex)                     \
  1009.         g_mutex_unlock (gdk_threads_mutex);     \
  1010.    } G_STMT_END
  1011. #else    /* !G_THREADS_ENABLED */
  1012. #  define GDK_THREADS_ENTER()
  1013. #  define GDK_THREADS_LEAVE()
  1014. #endif    /* !G_THREADS_ENABLED */
  1015.  
  1016. #include <gdk/gdkrgb.h>
  1017.  
  1018. #ifdef __cplusplus
  1019. }
  1020. #endif /* __cplusplus */
  1021.  
  1022.  
  1023. #endif /* __GDK_H__ */
  1024.